//
//  ClassRoomTableViewCell.m
//  AndCampus
//
//  Created by 史宵宵 on 2017/11/9.
//  Copyright © 2017年 史宵宵. All rights reserved.
//

#import "ClassRoomTableViewCell.h"

@implementation ClassRoomTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
//- (void)setFrame:(CGRect)frame {
//    
//    if (frame.origin.x==0) {
//        frame.origin.x += 10;
//    }
//    if (frame.size.width == kScreenW) {
//        
//        frame.size.width -= 2 * 10;
//    }
//    
//    [super setFrame:frame];
//    
//}
- (void)setClassRoomInfo:(ClassRoomInfo *)classRoomInfo{
    [self.classImageView sd_setImageWithURL:[NSURL URLWithString:classRoomInfo.logo] placeholderImage:KRECOMMENDLISTDEFAULT];
    self.classRoomTitle.text = classRoomInfo.course_name;
    self.classRoomContent.text = classRoomInfo.title;
    self.classRoomPeopleNumber.text = [NSString stringWithFormat:@"%@人参与", classRoomInfo.page_viewcount];
    self.classRoomPeopleMoney.text = [classRoomInfo.source_price isEqualToString:@"0"]? @"免费" : [NSString stringWithFormat:@"¥%@", classRoomInfo.source_price];
    self.classRoomPeopleMoney.textColor = [classRoomInfo.source_price isEqualToString:@"0"]? KBACKNAVIGATIONCOLOR:[UIColor redColor];
    if ([classRoomInfo.isVideo isEqualToString:@"1"]) {
        self.classTypeImage.image = [UIImage imageNamed:@"classlist_music"];
    }else if ([classRoomInfo.isVideo isEqualToString:@"2"]) {
        self.classTypeImage.image = [UIImage imageNamed:@"classlist_video"];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
